<template>
    <div>
        <input @change="change($event)" type="file"/>
        <img :src=this.img />
        <Button>提交</Button>
    </div>
</template>

<script>
    export default {
        name: "my-upload",
        data(){
            return{
                img:''
            }
        },
        methods:{
            change(e){
                let fileReader = new FileReader();
                fileReader.readAsDataURL(e.target.files[0])
                fileReader.onload =()=>{
                    this.img = fileReader.result
                }
                console.log(e.target.files[0] )
            }
        }
    }
</script>

<style scoped>

</style>